package com.sc.web.gwt.shared;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Wrapper Exception type for when a service method throws an unregistered, unchecked exception
 * that it consequently cannot marshal to the client.
 */
public class ServerException extends RuntimeException implements IsSerializable {

  public ServerException() { /* for GWT */ }

  public ServerException( Throwable t ) {
    super( t.getMessage() == null ? t.getClass().getName() : t.getMessage() );
  }

  public String toString() {
    return getMessage();
  }
}
